
/**操作按钮*/
function buttonFormatter(value, row, rowIndex) {
    if(row.status==1){
        return "<div class='btn-group'>" +
                    "<a class='btn btn-default btn-sm' href='javascript:userRole_obj(" + row.userId + ");'>" +
                    "<i class='glyphicon glyphicon-edit icon-white'>用户角色</i> " +
                    "</a>" +
                    "<a class='btn btn-default btn-sm' href='javascript:status_obj(" + row.userId + ",2);'>" +
                        "<i class='glyphicon glyphicon-ok icon-white'>离职</i> " +
                    "</a>" +
                    "<a class='btn btn-default btn-sm' href='javascript:edit_obj(" + row.userId + ");'>" +
                        "<i class='glyphicon glyphicon-pencil icon-white'>修改</i> " +
                    "</a>" +
                    "<a class='btn btn-default btn-sm' href='javascript:delete_obj(" + row.userId + ");'>" +
                        "<i class='glyphicon glyphicon-trash icon-white'>删除</i> " +
                    "</a>" +
                "</div>";
    }else{
        return "<div class='btn-group'>" +
                    "<a class='btn btn-default btn-sm' href='javascript:status_obj(" + row.userId + ",1);'>" +
                        "<i class='glyphicon glyphicon-unchecked icon-white'>在职</i> " +
                    "</a>" +
                    "<a class='btn btn-default btn-sm' href='javascript:edit_obj(" + row.userId + ");'>" +
                        "<i class='glyphicon glyphicon-pencil icon-white'>修改</i> " +
                    "</a>" +
                    "<a class='btn btn-default btn-sm' href='javascript:delete_obj(" + row.userId + ");'>" +
                        "<i class='glyphicon glyphicon-trash  icon-white'></i> 删除" +
                    "</a>" +
                "</div>";
    }

}
/**状态样式*/
function stateFormatter(value) {
    if (value == 1) {
        return ' <span class="label label-sm label-success"> 在职 </span>';
    } else {
        return '<span class="label label-sm label-danger"> 离职 </span>';
    }
}
/**所属部门样式*/
function departmentFormatter(value) {

    if (value == 1) {
        return ' <span class="label label-sm label-success"> 技术部 </span>';
    } else if (value == 2) {
        return ' <span class="label label-sm label-success"> 商务部 </span>';
    } else if (value == 3) {
        return ' <span class="label label-sm label-success"> 运营部 </span>';
    } else {
        return ' <span class="label label-sm label-success"> 其他 </span>';
    }
}
/**性别样式*/
function sexFormatter(value) {
    if (value == 1) {
        return ' <span class="label label-sm label-success"> 男 </span>';
    } else {
        return '<span class="label label-sm label-danger"> 女 </span>';
    }
}






